/*
 * Copyright (c) 2022 ASR Microelectronics (Shanghai) Co., Ltd. All rights reserved.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 ****************************************************************************************
 * @addtogroup INTC
 * @{
 ****************************************************************************************
 */

/*
 * INCLUDE FILES
 ****************************************************************************************
 */
#include <stdio.h>
#include "arch.h"
#include "sonata_ble_api.h"
#include "sonata_config.h"
#include "lega_rtos.h"
#ifdef SONATA_CFG_LOW_POWER
#include "sonata_sleep.h"
#include "hook.h"
#endif //SONATA_CFG_LOW_POWER
#include "asr_arch.h"
#if (STACK_BLE_EMB_PRESENT || BLE_EMB_PRESENT)
/**
 ****************************************************************************************
 * @brief BLE interrupt handler.
 *
 * This defines an interrupt handler to handle the interrupt with the number defined
 *  by the INTCNTL_BLE macro.
 ****************************************************************************************
 */
CRITICAL_FUNC_SEG void BLE_IRQHandler(void)
{
    lega_intrpt_enter();
    sonata_ble_isr();
    lega_intrpt_exit();
}

#endif //BLE_EMB_PRESENT

/// @} INTC
